#ifndef INITIALIZER_H
#define INITIALIZER_H

#include <string>
#include "GameCore/Core.h"
#include "Data/Data.h"
#include "Common/Collections/Store.h"
#include "Game/Logic/Scene.h"
#include "Game/Logic/Common/TextureInfo.h"
#include "Game/Logic/Map/Grid.h"

#include "Game/Logic/Common/ReusableBodyDef.h"
#include "Game/Logic/Common/ReusableRotorDef.h"

class Initializer
{
public:
	Initializer();

	Scene* Initialize( std::string sceneFilename );

private:
	Scene* CreateScene( const data::Scene& dataScene );
	Camera* CreateCamera( const data::Camera& dataCamera );

	int InitializeObstacle( Scene* scene, const data::Obstacle& dataObstacle );
	int InitializeCreature( Scene* scene, const data::Creature& dataCreature );
	int InitializeDetail( Scene* scene, int creatureId, const cmn::Transform& creaturePos, const data::Detail& dataDetail );
	int InitializeJunction( Scene* scene, int creatureId, const cmn::Transform& creaturePos, std::map<std::string, int>& detailNameToId, const data::Rotor& dataRotor );
	int InitializePlayer( Scene* scene, std::map<std::string, int>& creatureNameToId, const data::Player& dataPlayer );

private:
	cmn::Store<std::string, ReusableBodyDef*> m_reusableBodyDefStore;
	cmn::Store<std::string, ReusableRotorDef*> m_reusableRotorDefStore;
};

#endif
